package com.gxa.web_admin.controller.lyh;

import com.gxa.common.vo.R2;
import com.gxa.common.vo.ResultVo;
import com.gxa.modules.service.lyh.Customer_GoodsService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@Api(value = "消费者",tags = "消费者数据接口API")
@RequestMapping(value = "/customer")
public class Customer_GoodsController{
    @Autowired
    private Customer_GoodsService customer_goodsService;

    /**
     * 1.商品信息查询
     * @param
     * @return
     */
    @PostMapping(value = "/goodsquery")
    @ApiOperation(value ="商品信息查询" )
    public R2 goodsquery(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.goodsquery(map);
    }

    /**
     * 2.添加顾客订单
     * @param map
     * @return
     */
    @PostMapping(value = "/addCustomerOder")
    @ApiOperation(value ="添加订单" )
    public R2 addCustomerOder(@RequestBody @ApiParam(value = "map参数集合") List<Map> map){
        return customer_goodsService.addCustomerOder(map);
    }

    /**
     * 3.购物车查询
     * @param map
     * @return
     */
    @PostMapping(value = "/queryShopingCar")
    @ApiOperation(value ="查寻购物车" )
    public R2 queryShopingCar(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.queryShopingCar(map);
    }

    /**
     * 购物车添加
     * @param map
     * @return
     */
    @PostMapping(value = "/addShopingCar")
    @ApiOperation(value ="查寻购物车" )
    public R2 addShopingCar(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.addShopingCar(map);
    }

    /**
     * 购物车商品修改
     * @param map
     * @return
     */
    @PostMapping(value = "/updateShopingCar")
    @ApiOperation(value ="修改购物车信息" )
    public R2 updateShopingCar(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.updateShopingCar(map);
    }



    /**
     * 4.消费者页面的顾客订单查询
     * @param map
     * @return
     */
    @PostMapping(value = "/queryCustomerOder")
    @ApiOperation(value ="订单查询" )
    public R2 queryCustomerOder(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.queryCustomerOder(map);
    }


    /**
     * 5.消费者退货:修改该订单的状态为 维权状态
     * @param map
     * @return
     */
    @PostMapping(value = "/updateOrder")
    @ApiOperation(value ="订单退货（维权）" )
    public R2 updateOrder(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.updateOrder(map);
    }

    /**
     * 6.添加收货地址
     * @param map
     * @return
     */
    @PostMapping(value = "/addAdders")
    @ApiOperation(value ="添加收货地址" )
    public R2 addAdders(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.addAdders(map);
    }

    /**
     * 7.查询收货地址
     * @param map
     * @return
     */
    @PostMapping(value = "/queryAdders")
    @ApiOperation(value ="添加收货地址" )
    public R2 queryAdders(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.queryAdders(map);
    }

    /**
     * 8.修改收货地址
     * @param map
     * @return
     */
    @PostMapping(value = "/updateAdders")
    @ApiOperation(value ="添加收货地址" )
    public R2 updateAdders(@RequestBody @ApiParam(value = "map参数集合")Map map){
        return customer_goodsService.updateAdders(map);
    }

}
